package ch.ricosoft.hr.sorter;

import ch.ricosoft.hr.Team;

public final class HomeLossPointSorter extends InfoSorter {
	public int compare(Team o1, Team o2) {
		int diff = o1.getHomeLossPoints() - o2.getHomeLossPoints();
		if (diff == 0) {
			diff = o2.getHomeDiff() - o1.getHomeDiff();
			if (diff == 0) {
				diff = o2.getHomeMade() - o1.getHomeMade();
			}
		}
		return diff;
	}

	@Override
	public int getWins(Team t) {
		return t.getHomeWin();
	}

	@Override
	public int getDraws(Team t) {
		return t.getHomeDraw();
	}

	@Override
	public int getLoss(Team t) {
		return t.getHomeLoss();
	}

	@Override
	public int getMade(Team t) {
		return t.getHomeMade();
	}

	@Override
	public int getGotten(Team t) {
		return t.getHomeGotten();
	}

	@Override
	public int getDiff(Team t) {
		return t.getHomeDiff();
	}

	@Override
	public int getPoints(Team t) {
		return t.getHomePoints();
	}

	@Override
	public int getLossPoints(Team t) {
		return t.getHomeLossPoints();
	}
}